<template>
    <div class="payWrap">
        <div class="houseInfo">
            <h3>应缴费金额</h3>
            <p>缴费描述：{{waitPayData.roomName}}</p>
            <div class="price"><b>{{waitPayData.price}}</b>元</div>
        </div>
        <div class="payTypeSt">
            <h3>选择支付方式</h3>
            <div style="padding-top:20px">
                <pay-type :options="{money,houseInfo,paymentSettingId}"/>
            </div>
        </div>
    </div>
</template>

<script>
import { reactive,toRefs,onMounted } from 'vue'
import { useStore } from 'vuex'
import payType from '@/components/payType.vue'
export default {
    components:{
        payType
    },
    setup() {
        const store = useStore()
        const state = reactive({
            money:'',
            waitPayData:'',
            houseInfo:{},
            paymentSettingId:''
        })

        onMounted(()=>{
           state.waitPayData = JSON.parse(sessionStorage.getItem('waitPayData'))
           console.log("waitPayData:",state.waitPayData)
           state.money = state.waitPayData.price
           state.paymentSettingId = state.waitPayData.paymentSettingId
           state.houseInfo = {
               fangjianItem:{
                   phone:state.waitPayData.phone,
                   id:state.waitPayData.roomId
               },
               xqDataItem:{
                   id:store.state.carDetail.communityId
               }
           }
        })

        return{
            ...toRefs(state)
        }
    },
}
</script>

<style lang="scss" scoped>
    .payWrap{
        text-align: center;
        padding: 80px 0 0 0;
        .houseInfo{
            display: inline-block;
            padding: 37px 50px;
            background: #549dfe;
            border: 2px solid #fff;
            margin: 0 auto;
            line-height: normal;
            color: #fff;
            border-radius:10px ;
            min-width: 600px;
            h3{
                font-size: 35px;
                padding: 0;
                margin: 0;
                font-weight: 600;
                text-align: center;
            }
            p{
                font-size: 24px;
                padding: 25px 0 20px 0;
            }
            .price{
                color: #ffd200;
                font-size: 20px;
                font-weight: bold;
                b{
                    font-size: 40px;
                }
            }
        }
        .payTypeSt{
            line-height: normal;
            color: #fff;
            padding: 40px 0 0 0;
            h3{
                font-size: 35px;
                padding: 0;
                margin: 0;
                font-weight: 600;
                text-align: center;
            }
        }
    }
</style>